package com.maimao.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.model.user.Shop;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:45 下午
 */
public interface ShopMapper extends BaseMapper<Shop> {
    Shop findShopByOwnerAndSocial(@Param("owner") Long owner,@Param("social") Integer social);

    /**
     * 根据是否官方和品牌ID查询
     * 由于设置了owner与brandId的唯一索引，因此必然返回单个数据
     */
    Shop findShopBySocialAndBrandId(@Param("social") Integer social,@Param("brandId")Long brandId);

    /**
     * 根据店铺id查询用户邮箱
     * @param id 店铺id
     * @return
     */
    String queryUserEmailIdById(@Param("id") Long id);

    int updateBrandId(@Param("shopId") Long shopId,@Param("brandId") Long brandId);
}
